package services

import (
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
)

var Logger *zap.Logger

func InitLogger() {
	config := zap.NewProductionConfig()
	config.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
	Logger, _ = config.Build()
	defer Logger.Sync()
}

func LogInfo(message string, fields ...zap.Field) {
	Logger.Info(message, fields...)
}

func LogError(message string, fields ...zap.Field) {
	Logger.Error(message, fields...)
}
